var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, o) {
        e.__proto__ = o;
    } || function(e, o) {
        for (var t in o) o.hasOwnProperty(t) && (e[t] = o[t]);
    })(e, t);
}, function(e, t) {
    function l() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (l.prototype = t.prototype, 
    new l());
}), a = this && this.__decorate || function(e, o, t, l) {
    var c, s = arguments.length, n = s < 3 ? o : null === l ? l = Object.getOwnPropertyDescriptor(o, t) : l;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(e, o, t, l); else for (var a = e.length - 1; 0 <= a; a--) (c = e[a]) && (n = (s < 3 ? c(n) : 3 < s ? c(o, t, n) : c(o, t)) || n);
    return 3 < s && n && Object.defineProperty(o, t, n), n;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("Global"), s = e("AudioManager"), c = e("GameConfig"), l = e("GameData"), d = e("UIManager"), u = e("WebManager"), p = cc._decorator, h = p.ccclass, f = p.property, g = function(o) {
    function e() {
        var e = null !== o && o.apply(this, arguments) || this;
        return e.light = null, e;
    }
    return i(e, o), e.prototype.onLoad = function() {
        if (l.GD.isFollow) this.node.active = !1; else {
            if (GA.isPlatform(GA.Platform.ByteDance)) {
                if (cc.sys.os == cc.sys.OS_IOS) return void this.node.destroy();
                var e = GA.PA.getSystemInfoSync();
                if (console.log("appName:", e.appName, "is Douyin:", "Douyin" == e.appName, "isFollow:", l.GD.isFollow), 
                "devtools" != e.appName && "Douyin" != e.appName) return void (this.node.active = !1);
            }
            this.checkFollowAwemeState({});
        }
    }, e.prototype.onClick = function() {
        var e, o, t = this;
        s.default.getInstance().playAudio("按钮2"), GA.Info.underCheck && c.GC.isDebug ? (d.default.getInstance().hideAllPnl(), 
        PD.tag = "follow", PD.data = {}, d.default.getInstance().loadPnl("eggsDesktop")) : (u.default.getInstance().sentLog("点击关注有礼按键"), 
        r.G.isFollow ? GA.isPlatform(GA.Platform.Kwaigame) ? d.default.getInstance().showToast({
            str: "已关注"
        }) : null === (o = null === (e = GA.PA) || void 0 === e ? void 0 : e.showToast) || void 0 === o || o.call(e, {
            title: "已关注",
            icon: "none"
        }) : c.GC.isVaild("follow") || l.GD.isFollow ? this.openAwemeUserProfile({
            success: function() {
                t.checkFollowAwemeState({});
            }
        }) : (d.default.getInstance().hideAllPnl(), PD.tag = "follow", PD.data = {}, d.default.getInstance().loadPnl("eggsDesktop")));
    }, e.prototype.checkFollowAwemeState = function(o) {
        GA.isPlatform(GA.Platform.ByteDance) ? GA.PA && GA.PA.checkFollowAwemeState({
            success: function(e) {
                console.log("checkFollowAwemeState success", e), e.hasFollowed ? r.G.isFollow = !0 : r.G.isFollow = !1, 
                o.success && o.success(e);
            },
            fail: function(e) {
                console.log("checkFollowAwemeState fail", e);
            }
        }) : GA.isPlatform(GA.Platform.Kwaigame) && ks && ks.checkFollowState({
            accountType: "CPServiceAccount",
            callback: function(e) {
                1 == e.errorCode ? (console.log("checkFollowState success", e), e.hasFollow ? r.G.isFollow = !0 : r.G.isFollow = !1, 
                o.success && o.success(e)) : console.log("checkFollowState fail", e);
            }
        });
    }, e.prototype.openAwemeUserProfile = function(o) {
        GA.isPlatform(GA.Platform.ByteDance) ? GA.PA && GA.PA.openAwemeUserProfile({
            success: function(e) {
                console.log("openAwemeUserProfile success", e), o.success && o.success(e);
            },
            fail: function(e) {
                console.log("openAwemeUserProfile fail", e);
            }
        }) : GA.isPlatform(GA.Platform.Kwaigame) && ks && ks.openUserProfile({
            accountType: "CPServiceAccount",
            callback: function(e) {
                1 == e.errorCode ? (console.log("openUserProfile success", e), o.success && o.success(e)) : console.log("openUserProfile fail", e);
            }
        });
    }, e.prototype.start = function() {
        cc.tween(this.light).repeatForever(cc.tween().by(2, {
            angle: 60
        })).start();
    }, a([ f(cc.Node) ], e.prototype, "light", void 0), a([ h ], e);
}(cc.Component);

n.default = g;